#ifndef CPP_SIMPLE_PROGRESS_BAR_H
#define CPP_SIMPLE_PROGRESS_BAR_H

#include <Bitmap.h>
#include <widget/ProgressBar.h>

//@brief 简单进度条
//@author cvte
//@description 进度条控件，不需要图片资源，动态绘制
class SimpleProgressBar : public ProgressBar {
   public:
    typedef enum {
        BRA_TYPE_NONE,
        BAR_TYPE_LEFT_RIGHT,          //从左到右进度
        BAR_TYPE_DOWN_UP,             //从下到上进度
        BAR_TYPE_COUNT
    } BAR_TYPE;

    SimpleProgressBar();
    ~SimpleProgressBar();

    void setBarType(BAR_TYPE barType);
    void setBarBackgroundColor(int color);
    void setBarForegroundColor(int color);
    //@method 设置圆角
    void setBarRoundRectValue(int round);

   protected:
    void onDraw(Canvas& canvas);

   private:
    int mBarType = BAR_TYPE_LEFT_RIGHT;
    int mBarBackgroundColor = 0; //进度条背景色
    int mBarForegroundColor = 0; //进度条前景色
    int mBarRound = 0; //圆角值
};

#endif